package com.example.lenovo.weiyi;

import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.bigkoo.svprogresshud.SVProgressHUD;
import com.com.ruanmeng.demon.ChoosePintPlaceM;
import com.com.ruanmeng.demon.CommonM;
import com.com.ruanmeng.demon.PointPlaceM;
import com.com.ruanmeng.utils.CommonUtil;
import com.com.ruanmeng.utils.Params;
import com.com.ruanmeng.utils.PreferencesUtils;
import com.yolanda.nohttp.NoHttp;
import com.yolanda.nohttp.rest.Request;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;
import nohttp.CallServer;
import nohttp.CustomHttpListener;
import share.Const;
import share.HttpIP;

/**
 * 选择疼痛位置
 */
public class ChoosePainPlaceActivity extends BaseActivity {

    private static SVProgressHUD progress;
    @BindView(R.id.tv_bei)
    TextView tvBei;
    @BindView(R.id.tv_ce)
    TextView tvCe;
    @BindView(R.id.view_sline)
    View viewSline;
    @BindView(R.id.imv_tou1)
    ImageView imvTou1;
    @BindView(R.id.imv_tou2)
    ImageView imvTou2;
    @BindView(R.id.imv_jing1)
    ImageView imvJing1;
    @BindView(R.id.imv_jing2)
    ImageView imvJing2;
    @BindView(R.id.imv_left_b1)
    ImageView imvLeftB1;
    @BindView(R.id.imv_left_b2)
    ImageView imvLeftB2;
    @BindView(R.id.imv_left_b3)
    ImageView imvLeftB3;
    @BindView(R.id.imv_left_b4)
    ImageView imvLeftB4;
    @BindView(R.id.imv_left_b5)
    ImageView imvLeftB5;
    @BindView(R.id.imv_left_b6)
    ImageView imvLeftB6;
    @BindView(R.id.imv_right_b1)
    ImageView imvRightB1;
    @BindView(R.id.imv_right_b2)
    ImageView imvRightB2;
    @BindView(R.id.imv_right_b3)
    ImageView imvRightB3;
    @BindView(R.id.imv_right_b4)
    ImageView imvRightB4;
    @BindView(R.id.imv_right_b5)
    ImageView imvRightB5;
    @BindView(R.id.imv_right_b6)
    ImageView imvRightB6;
    @BindView(R.id.linearLayout)
    LinearLayout linearLayout;
    @BindView(R.id.imv_xiong2)
    ImageView imvXiong2;
    @BindView(R.id.imv_xiong3)
    ImageView imvXiong3;
    @BindView(R.id.imv_fu1)
    ImageView imvFu1;
    @BindView(R.id.imv_fu2)
    ImageView imvFu2;
    @BindView(R.id.imv_tun1)
    ImageView imvTun1;
    @BindView(R.id.imv_tun2)
    ImageView imvTun2;
    @BindView(R.id.imv_bigtui1)
    ImageView imvBigtui1;
    @BindView(R.id.imv_bigtui2)
    ImageView imvBigtui2;
    @BindView(R.id.imv_xg1)
    ImageView imvXg1;
    @BindView(R.id.imv_xg2)
    ImageView imvXg2;
    @BindView(R.id.imv_smalltui1)
    ImageView imvSmalltui1;
    @BindView(R.id.imv_smalltui2)
    ImageView imvSmalltui2;
    @BindView(R.id.imv_foot1)
    ImageView imvFoot1;
    @BindView(R.id.imv_foot2)
    ImageView imvFoot2;
    @BindView(R.id.tv_zheng)
    TextView tvZheng;
    private LinearLayout ll_first_zhong;
    private CheckBox cb_first_zhong, cb_first_very;
    private LinearLayout ll_first_very;
    private LinearLayout ll_first_weak, ll_first_center, ll_first_better, ll_s_ct, ll_s_jy, ll_s_cm, ll_s_st, ll_s_zr, ll_f_alltime;
    private CheckBox cb_weak, cb_center, cb_better, cb_s_ct, cb_s_jy, cb_s_cm, cb_s_st, cb_s_zr;
    private LinearLayout ll_t_one, ll_t_seconed, ll_t_third, ll_t_four, l, l_f_alltime, ll_f_sometimes, ll_f_oe;
    private CheckBox cb_t_one, cb_t_seconed, cb_t_third, cb_t_four, cb_f_alltime, cb_f_sometimes, cb_f_oe;
    private PopupWindow pop;
    //选中图片位置数组
    ArrayList<String> Temp_index = new ArrayList<>();
    ArrayList<PointPlaceM.RowsBean> Temp_ListPlace = new ArrayList<>();
    String index;//选中图编号
    String choose_name;//选中图名字
    String strength;//疼痛强度
    String symptom;//疼痛症状
    String startDate;//疼痛周期
    String frequency;//疼痛频率
    private Button bt_pop_del;
    int IsZheng = 0;//0   正面   1背面
    int Is_sureorDel = 0;//是否是点击确定或者删除是的popwindow消失的
    private LinearLayout ll_t_newadd;
    private CheckBox cb_t_newadd;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_choose_pain_place);
        ButterKnife.bind(this);
        ChangLayTitle("选择疼痛位置");
        AddActivity(this);
        LayBack();
        ShowLayNext();
        init();
        getPointPlaceData();
    }

    public void init() {
        imvTou1.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                return false;
            }
        });
    }

    public void PicClick(View v) {
        switch (v.getId()) {
            /**
             * 关于图片
             */
            case R.id.imv_tou1:
                if (IsZheng == 0) {
                    index = "01";
                    choose_name = "正面右头部";
                } else {
                    index = "31";
                    choose_name = "背面左头部";
                }
                break;
            case R.id.imv_tou2:
                if (IsZheng == 0) {
                    index = "10";
                    choose_name = "正面左头部";
                } else {
                    index = "40";
                    choose_name = "背面右头部";
                }
                break;
            case R.id.imv_jing1:
                if (IsZheng == 0) {
                    index = "02";
                    choose_name = "正面右颈部";
                } else {
                    index = "32";
                    choose_name = "背面左颈部";
                }
                break;
            case R.id.imv_jing2:
                if (IsZheng == 0) {
                    index = "11";
                    choose_name = "正面左颈部";
                } else {
                    index = "41";
                    choose_name = "背面右颈部";
                }
                break;
            case R.id.imv_left_b1:
                if (IsZheng == 0) {
                    index = "19";
                    choose_name = "正面右肩部";
                } else {
                    index = "49";
                    choose_name = "背面左肩部";
                }
                break;
            case R.id.imv_left_b2:
                if (IsZheng == 0) {
                    index = "20";
                    choose_name = "正面右上臂";
                } else {
                    index = "50";
                    choose_name = "背面左上臂";
                }
                break;
            case R.id.imv_left_b3:
                if (IsZheng == 0) {
                    index = "21";
                    choose_name = "正面右肘部";
                } else {
                    index = "51";
                    choose_name = "背面左肘部";
                }
                break;
            case R.id.imv_left_b4:
                if (IsZheng == 0) {
                    index = "22";
                    choose_name = "正面右前臂";
                } else {
                    index = "52";
                    choose_name = "背面左前臂";
                }
                break;
            case R.id.imv_left_b5:
                if (IsZheng == 0) {
                    index = "23";
                    choose_name = "正面右腕部";
                } else {
                    index = "53";
                    choose_name = "背面左腕部";
                }
                break;
            case R.id.imv_left_b6:
                if (IsZheng == 0) {
                    index = "24";
                    choose_name = "正面右手部";
                } else {
                    index = "54";
                    choose_name = "背面左手部";
                }
                break;
            case R.id.imv_right_b1:
                if (IsZheng == 0) {
                    index = "25";
                    choose_name = "正面左肩部";
                } else {
                    index = "55";
                    choose_name = "背面右肩部";
                }
                break;
            case R.id.imv_right_b2:
                if (IsZheng == 0) {
                    index = "26";
                    choose_name = "正面左上臂";
                } else {
                    index = "56";
                    choose_name = "背面右上臂";
                }
                break;
            case R.id.imv_right_b3:
                if (IsZheng == 0) {
                    index = "27";
                    choose_name = "正面左肘部";
                } else {
                    index = "57";
                    choose_name = "背面右肘部";
                }
                break;
            case R.id.imv_right_b4:
                if (IsZheng == 0) {
                    index = "28";
                    choose_name = "正面左前臂";
                } else {
                    index = "58";
                    choose_name = "背面右前臂";
                }
                break;
            case R.id.imv_right_b5:
                if (IsZheng == 0) {
                    index = "29";
                    choose_name = "正面左腕部";
                } else {
                    index = "59";
                    choose_name = "背面右腕部";
                }
                break;
            case R.id.imv_right_b6:
                if (IsZheng == 0) {
                    index = "30";
                    choose_name = "正面左手部";
                } else {
                    index = "60";
                    choose_name = "背面右手部";
                }
                break;
            case R.id.imv_xiong2:
                if (IsZheng == 0) {
                    index = "03";
                    choose_name = "正面右胸部";
                } else {
                    index = "33";
                    choose_name = "背面左背部";
                }
                break;
            case R.id.imv_xiong3:
                if (IsZheng == 0) {
                    index = "12";
                    choose_name = "正面左胸部";
                } else {
                    index = "42";
                    choose_name = "背面右背部";
                }
                break;
            case R.id.imv_fu1:
                if (IsZheng == 0) {
                    index = "04";
                    choose_name = "正面右腹部";
                } else {
                    index = "34";
                    choose_name = "背面左腹部";
                }
                break;
            case R.id.imv_fu2:
                if (IsZheng == 0) {
                    index = "13";
                    choose_name = "正面左腹部";
                } else {
                    index = "43";
                    choose_name = "背面右腹部";
                }
                break;
            case R.id.imv_tun1:
                if (IsZheng == 0) {
                    index = "05";
                    choose_name = "正面右胯部";
                } else {
                    index = "35";
                    choose_name = "背面左臀部";
                }
                break;
            case R.id.imv_tun2:
                if (IsZheng == 0) {
                    index = "14";
                    choose_name = "正面左胯部";
                } else {
                    index = "44";
                    choose_name = "背面右臀部";
                }
                break;
            case R.id.imv_bigtui1:
                if (IsZheng == 0) {
                    index = "06";
                    choose_name = "正面右大腿部";
                } else {
                    index = "36";
                    choose_name = "背面左大腿部";
                }
                break;
            case R.id.imv_bigtui2:
                if (IsZheng == 0) {
                    index = "15";
                    choose_name = "正面左大腿部";
                } else {
                    index = "45";
                    choose_name = "背面右大腿部";
                }
                break;
            case R.id.imv_xg1:
                if (IsZheng == 0) {
                    index = "07";
                    choose_name = "正面右膝盖部";
                } else {
                    index = "37";
                    choose_name = "背面左膝盖部";
                }
                break;
            case R.id.imv_xg2:
                if (IsZheng == 0) {
                    index = "16";
                    choose_name = "正面左膝盖部";
                } else {
                    index = "46";
                    choose_name = "背面右膝盖部";
                }
                break;
            case R.id.imv_smalltui1:
                if (IsZheng == 0) {
                    index = "08";
                    choose_name = "正面右小腿部";
                } else {
                    index = "38";
                    choose_name = "背面左小腿部";
                }
                break;
            case R.id.imv_smalltui2:
                if (IsZheng == 0) {
                    index = "17";
                    choose_name = "正面左小腿部";
                } else {
                    index = "47";
                    choose_name = "背面右小腿部";
                }
                break;
            case R.id.imv_foot1:
                if (IsZheng == 0) {
                    index = "09";
                    choose_name = "正面右脚部";
                } else {
                    index = "39";
                    choose_name = "背面左脚部";
                }
                break;
            case R.id.imv_foot2:
                if (IsZheng == 0) {
                    index = "18";
                    choose_name = "正面左脚部";
                } else {
                    index = "48";
                    choose_name = "背面右脚部";
                }
                break;

        }
        ShowTiShi();

    }

    public void doClick(View v) {
        Intent in;
        switch (v.getId()) {
            case R.id.tv_lay_next://下一步
                if (("1").equals(Params.isDati)) {//做过题
                    in = new Intent(ChoosePainPlaceActivity.this, SeeAllCeShiActivity.class);
                    in.putExtra("id", getIntent().getStringExtra("id"));
                    startActivity(in);
                } else {//有选择疼痛位置就去调查  没有选择疼痛位置就直接跳转到禁忌症页面
                    if (Temp_index.size()==0) {
                        in = new Intent(ChoosePainPlaceActivity.this, JinJiSurveyActivity.class);
                        in.putExtra("id", getIntent().getStringExtra("id"));
                        startActivity(in);
                    } else {
                        in = new Intent(ChoosePainPlaceActivity.this, SurveyActivity.class);
                        in.putExtra("id", getIntent().getStringExtra("id"));
                        startActivity(in);
                    }
                }
                break;
            case R.id.li_zheng://正
                IsZheng = 0;
                tvZheng.setBackgroundResource(R.drawable.ed_main);
                tvZheng.setTextColor(getResources().getColor(R.color.MainColor));
                tvBei.setBackgroundResource(R.drawable.ed_gray);
                tvBei.setTextColor(getResources().getColor(R.color.FirstGrayColor));
                tvCe.setBackgroundResource(R.drawable.ed_gray);
                tvCe.setTextColor(getResources().getColor(R.color.FirstGrayColor));
                ChangePicState(Temp_index);
                break;
            case R.id.li_bei://背
                IsZheng = 1;
                tvZheng.setBackgroundResource(R.drawable.ed_gray);
                tvZheng.setTextColor(getResources().getColor(R.color.FirstGrayColor));
                tvBei.setBackgroundResource(R.drawable.ed_main);
                tvBei.setTextColor(getResources().getColor(R.color.MainColor));
                tvCe.setBackgroundResource(R.drawable.ed_gray);
                tvCe.setTextColor(getResources().getColor(R.color.FirstGrayColor));
                ChangePicState(Temp_index);
                break;
            case R.id.li_ce://测
                tvZheng.setBackgroundResource(R.drawable.ed_gray);
                tvZheng.setTextColor(getResources().getColor(R.color.FirstGrayColor));
                tvBei.setBackgroundResource(R.drawable.ed_gray);
                tvBei.setTextColor(getResources().getColor(R.color.FirstGrayColor));
                tvCe.setBackgroundResource(R.drawable.ed_main);
                tvCe.setTextColor(getResources().getColor(R.color.MainColor));
                break;
            /**
             * 关于pop
             */
            //问题一
            case R.id.ll_first_weak:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_weak.isChecked() == true) {
                        cb_weak.setChecked(false);
                    } else {
                        cb_weak.setChecked(true);
                        cb_center.setChecked(false);
                        cb_better.setChecked(false);
                        cb_first_zhong.setChecked(false);
                        cb_first_very.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_first_center:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_center.isChecked() == true) {
                        cb_center.setChecked(false);
                    } else {
                        cb_center.setChecked(true);
                        cb_weak.setChecked(false);
                        cb_better.setChecked(false);
                        cb_first_zhong.setChecked(false);
                        cb_first_very.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_first_better:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_better.isChecked() == true) {
                        cb_better.setChecked(false);
                    } else {
                        cb_better.setChecked(true);
                        cb_center.setChecked(false);
                        cb_weak.setChecked(false);
                        cb_first_zhong.setChecked(false);
                        cb_first_very.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_first_zhong:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_first_zhong.isChecked() == true) {
                        cb_first_zhong.setChecked(false);
                    } else {
                        cb_first_zhong.setChecked(true);
                        cb_better.setChecked(false);
                        cb_first_very.setChecked(false);
                        cb_center.setChecked(false);
                        cb_weak.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_first_very:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_first_very.isChecked() == true) {
                        cb_first_very.setChecked(false);
                    } else {
                        cb_first_very.setChecked(true);
                        cb_first_zhong.setChecked(false);
                        cb_better.setChecked(false);
                        cb_center.setChecked(false);
                        cb_weak.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            //问题二
            case R.id.ll_s_ct:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_s_ct.isChecked() == true) {
                        cb_s_ct.setChecked(false);
                    } else {
                        cb_s_ct.setChecked(true);
                        cb_s_jy.setChecked(false);
                        cb_s_cm.setChecked(false);
                        cb_s_st.setChecked(false);
                        cb_s_zr.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_s_jy:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_s_jy.isChecked() == true) {
                        cb_s_jy.setChecked(false);
                    } else {
                        cb_s_jy.setChecked(true);
                        cb_s_ct.setChecked(false);
                        cb_s_cm.setChecked(false);
                        cb_s_st.setChecked(false);
                        cb_s_zr.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_s_cm:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_s_cm.isChecked() == true) {
                        cb_s_cm.setChecked(false);
                    } else {
                        cb_s_cm.setChecked(true);
                        cb_s_jy.setChecked(false);
                        cb_s_ct.setChecked(false);
                        cb_s_st.setChecked(false);
                        cb_s_zr.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_s_st:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_s_st.isChecked() == true) {
                        cb_s_st.setChecked(false);
                    } else {
                        cb_s_st.setChecked(true);
                        cb_s_cm.setChecked(false);
                        cb_s_jy.setChecked(false);
                        cb_s_ct.setChecked(false);
                        cb_s_zr.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_s_zr:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_s_zr.isChecked() == true) {
                        cb_s_zr.setChecked(false);
                    } else {
                        cb_s_zr.setChecked(true);
                        cb_s_st.setChecked(false);
                        cb_s_cm.setChecked(false);
                        cb_s_jy.setChecked(false);
                        cb_s_ct.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            //问题三
            case R.id.ll_t_newadd:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_t_newadd.isChecked() == true) {
                        cb_t_newadd.setChecked(false);
                    } else {
                        cb_t_newadd.setChecked(true);
                        cb_t_one.setChecked(false);
                        cb_t_seconed.setChecked(false);
                        cb_t_third.setChecked(false);
                        cb_t_four.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_t_one:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_t_one.isChecked() == true) {
                        cb_t_one.setChecked(false);
                    } else {
                        cb_t_one.setChecked(true);
                        cb_t_seconed.setChecked(false);
                        cb_t_third.setChecked(false);
                        cb_t_four.setChecked(false);
                        cb_t_newadd.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_t_seconed:
                if (Params.assessStatus != 2) {//==2只可看  不能修改

                    if (cb_t_seconed.isChecked() == true) {
                        cb_t_seconed.setChecked(false);
                    } else {
                        cb_t_seconed.setChecked(true);
                        cb_t_one.setChecked(false);
                        cb_t_third.setChecked(false);
                        cb_t_four.setChecked(false);
                        cb_t_newadd.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_t_third:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_t_third.isChecked() == true) {
                        cb_t_third.setChecked(false);
                    } else {
                        cb_t_third.setChecked(true);
                        cb_t_seconed.setChecked(false);
                        cb_t_one.setChecked(false);
                        cb_t_four.setChecked(false);
                        cb_t_newadd.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_t_four:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_t_four.isChecked() == true) {
                        cb_t_four.setChecked(false);
                    } else {
                        cb_t_four.setChecked(true);
                        cb_t_third.setChecked(false);
                        cb_t_seconed.setChecked(false);
                        cb_t_one.setChecked(false);
                        cb_t_newadd.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            //问题四
            case R.id.ll_f_alltime:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_f_alltime.isChecked() == true) {
                        cb_f_alltime.setChecked(false);
                    } else {
                        cb_f_alltime.setChecked(true);
                        cb_f_sometimes.setChecked(false);
                        cb_f_oe.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_f_sometimes:
                if (Params.assessStatus != 2) {//==2只可看  不能修改
                    if (cb_f_sometimes.isChecked() == true) {
                        cb_f_sometimes.setChecked(false);
                    } else {
                        cb_f_sometimes.setChecked(true);
                        cb_f_alltime.setChecked(false);
                        cb_f_oe.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.ll_f_oe:
                if (Params.assessStatus != 2) { //==2只可看  不能修改
                    if (cb_f_oe.isChecked() == true) {
                        cb_f_oe.setChecked(false);
                    } else {
                        cb_f_oe.setChecked(true);
                        cb_f_sometimes.setChecked(false);
                        cb_f_alltime.setChecked(false);
                    }
                } else {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "您已提交完成，如需修改请 联系康复师！");
                }
                break;
            case R.id.bt_pop_sure:
                pop.dismiss();
                break;

        }
    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        switch (view.getId()) {
            case R.id.ll_first_weak:

                break;
        }
    }

    /**
     * 关于弹窗提示
     */
    public void ShowTiShi() {
        // 加载布局
        LayoutInflater inflater = LayoutInflater
                .from(ChoosePainPlaceActivity.this);
        View view = inflater.inflate(R.layout.pop_choosepineplace, null);
        View view_choose_cancel = (View) view.findViewById(R.id.view_choose_cancel);
        TextView tv_choose_place = (TextView) view.findViewById(R.id.tv_choose_place);
        Button bt_pop_sure = (Button) view.findViewById(R.id.bt_pop_sure);
        bt_pop_del = (Button) view.findViewById(R.id.bt_pop_del);
        tv_choose_place.setText("请回答关于“" + choose_name + "”的疼痛情况");
        //问题一
        ll_first_weak = (LinearLayout) view.findViewById(R.id.ll_first_weak);
        cb_weak = (CheckBox) view.findViewById(R.id.cb_weak);
        ll_first_center = (LinearLayout) view.findViewById(R.id.ll_first_center);
        cb_center = (CheckBox) view.findViewById(R.id.cb_center);
        ll_first_better = (LinearLayout) view.findViewById(R.id.ll_first_better);
        cb_better = (CheckBox) view.findViewById(R.id.cb_better);
        ll_first_zhong = (LinearLayout) view.findViewById(R.id.ll_first_zhong);
        cb_first_zhong = (CheckBox) view.findViewById(R.id.cb_first_zhong);
        ll_first_very = (LinearLayout) view.findViewById(R.id.ll_first_very);
        cb_first_very = (CheckBox) view.findViewById(R.id.cb_first_very);
        //问题二
        ll_s_ct = (LinearLayout) view.findViewById(R.id.ll_s_ct);
        cb_s_ct = (CheckBox) view.findViewById(R.id.cb_s_ct);
        ll_s_jy = (LinearLayout) view.findViewById(R.id.ll_s_jy);
        cb_s_jy = (CheckBox) view.findViewById(R.id.cb_s_jy);
        ll_s_cm = (LinearLayout) view.findViewById(R.id.ll_s_cm);
        cb_s_cm = (CheckBox) view.findViewById(R.id.cb_s_cm);
        ll_s_st = (LinearLayout) view.findViewById(R.id.ll_s_st);
        cb_s_st = (CheckBox) view.findViewById(R.id.cb_s_st);
        ll_s_zr = (LinearLayout) view.findViewById(R.id.ll_s_zr);
        cb_s_zr = (CheckBox) view.findViewById(R.id.cb_s_zr);
        //问题三

        ll_t_newadd = (LinearLayout) view.findViewById(R.id.ll_t_newadd);
        cb_t_newadd = (CheckBox) view.findViewById(R.id.cb_t_newadd);
        ll_t_one = (LinearLayout) view.findViewById(R.id.ll_t_one);
        cb_t_one = (CheckBox) view.findViewById(R.id.cb_t_one);
        ll_t_seconed = (LinearLayout) view.findViewById(R.id.ll_t_seconed);
        cb_t_seconed = (CheckBox) view.findViewById(R.id.cb_t_seconed);
        ll_t_third = (LinearLayout) view.findViewById(R.id.ll_t_third);
        cb_t_third = (CheckBox) view.findViewById(R.id.cb_t_third);
        ll_t_four = (LinearLayout) view.findViewById(R.id.ll_t_four);
        cb_t_four = (CheckBox) view.findViewById(R.id.cb_t_four);
        //问题四
        ll_f_alltime = (LinearLayout) view.findViewById(R.id.ll_f_alltime);
        cb_f_alltime = (CheckBox) view.findViewById(R.id.cb_f_alltime);
        ll_f_sometimes = (LinearLayout) view.findViewById(R.id.ll_f_sometimes);
        cb_f_sometimes = (CheckBox) view.findViewById(R.id.cb_f_sometimes);
        ll_f_oe = (LinearLayout) view.findViewById(R.id.ll_f_oe);
        cb_f_oe = (CheckBox) view.findViewById(R.id.cb_f_oe);
        // 创建popupwindow对话框
        pop = new PopupWindow(view, ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT);
        pop.setFocusable(true);// 必须有，因为要获得焦点进行输入
        // 设置此参数，点击外边可消失
        pop.setBackgroundDrawable(new BitmapDrawable());
        // 点击其他除了popupwindow对话框的地方就可使popupwindow对话框消失
        pop.setOutsideTouchable(true);
//        pop.showAtLocation(liFr, Gravity.CENTER, 0, 0);// 显示位置以某控件为中心
        if (Build.VERSION.SDK_INT >= 24) {
            int[] a = new int[2];
            viewSline.getLocationInWindow(a);
            pop.showAtLocation((ChoosePainPlaceActivity.this).getWindow().getDecorView(), Gravity.NO_GRAVITY, 0, a[1] + viewSline.getHeight());
        } else {
            pop.showAsDropDown(viewSline);
        }
        SetPopDate(index);
        //点击图片高亮
        if (bt_pop_del.getVisibility() == View.GONE) {
            Temp_index.add(index);//放入加数据  被点击图片高亮
            ChangePicState(Temp_index);
        }
        pop.setOnDismissListener(new PopupWindow.OnDismissListener() {
            @Override
            public void onDismiss() {
                if (bt_pop_del.getVisibility() == View.GONE) {
                    for (int i = 0; i < Temp_index.size(); i++) {
                        if (index.equals(Temp_index.get(i))) {
                            Temp_index.remove(i);
                            ChangePicState(Temp_index);
                        }
                    }
                }
            }
        });
        view_choose_cancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                pop.dismiss();
            }
        });
        bt_pop_sure.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //非空判断
                if (cb_weak.isChecked() == false && cb_center.isChecked() == false && cb_better.isChecked() == false && cb_first_zhong.isChecked() == false && cb_first_very.isChecked() == false) {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "请选择疼痛强度！");
                    return;
                }
                if (cb_s_ct.isChecked() == false && cb_s_jy.isChecked() == false && cb_s_cm.isChecked() == false && cb_s_st.isChecked() == false && cb_s_zr.isChecked() == false) {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "请选择疼痛症状！");
                    return;
                }
                if (cb_t_newadd.isChecked() == false && cb_t_one.isChecked() == false && cb_t_seconed.isChecked() == false && cb_t_third.isChecked() == false && cb_t_four.isChecked() == false) {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "请选择出现疼痛时间！");
                    return;
                }
                if (cb_f_alltime.isChecked() == false && cb_f_sometimes.isChecked() == false && cb_f_oe.isChecked() == false) {
                    CommonUtil.showToask(ChoosePainPlaceActivity.this, "请选择疼痛频率！");
                    return;
                }
                //String strength;//疼痛强度
                if (cb_weak.isChecked() == true) {
                    strength = "极轻";
                }
                if (cb_center.isChecked() == true) {
                    strength = "轻微";
                }
                if (cb_better.isChecked() == true) {
                    strength = "中度";
                }
                if (cb_first_zhong.isChecked() == true) {
                    strength = "重";
                }
                if (cb_first_very.isChecked() == true) {
                    strength = "极重";
                }
                // String symptom;//疼痛症状
                if (cb_s_ct.isChecked() == true) {
                    symptom = "刺痛";
                }
                if (cb_s_jy.isChecked() == true) {
                    symptom = "僵硬感";
                }
                if (cb_s_cm.isChecked() == true) {
                    symptom = "串麻痛";
                }
                if (cb_s_st.isChecked() == true) {
                    symptom = "酸痛";
                }
                if (cb_s_zr.isChecked() == true) {
                    symptom = "灼热性";
                }
                // String startDate;//疼痛周期
                if (cb_t_newadd.isChecked() == true) {
                    startDate = "近两周内";
                }
                if (cb_t_one.isChecked() == true) {
                    startDate = "2-3周前";
                }
                if (cb_t_seconed.isChecked() == true) {
                    startDate = "3个月前";
                }
                if (cb_t_third.isChecked() == true) {
                    startDate = "3-6个月前";
                }
                if (cb_t_four.isChecked() == true) {
                    startDate = "大于6个月";
                }
                //String frequency;//疼痛频率
                if (cb_f_alltime.isChecked() == true) {
                    frequency = "持续不断";
                }
                if (cb_f_sometimes.isChecked() == true) {
                    frequency = "经常发生";
                }
                if (cb_f_oe.isChecked() == true) {
                    frequency = "偶尔发生";
                }
                Is_sureorDel = 1;
                pop.dismiss();
                getChooseData();
            }
        });
        bt_pop_del.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Is_sureorDel = 1;
                pop.dismiss();
                getDelChooseData();
            }
        });
        if (Params.assessStatus == 2) {//只可看  不能修改
            cb_weak.setClickable(false);
            cb_center.setClickable(false);
            cb_better.setClickable(false);
            cb_first_zhong.setClickable(false);
            cb_first_very.setClickable(false);

            cb_s_ct.setClickable(false);
            cb_s_jy.setClickable(false);
            cb_s_cm.setClickable(false);
            cb_s_st.setClickable(false);
            cb_s_zr.setClickable(false);

            cb_t_one.setClickable(false);
            cb_t_seconed.setClickable(false);
            cb_t_third.setClickable(false);
            cb_t_four.setClickable(false);

            cb_f_alltime.setClickable(false);
            cb_f_sometimes.setClickable(false);
            cb_f_oe.setEnabled(false);

            bt_pop_sure.setVisibility(View.GONE);
            bt_pop_del.setVisibility(View.GONE);

        }
    }

    /**
     * POP   Date
     */
    public void SetPopDate(String click_index) {
        for (int i = 0; i < Temp_index.size(); i++) {
            if ((click_index).equals(Temp_index.get(i))) {
                bt_pop_del.setVisibility(View.VISIBLE);
                strength = Temp_ListPlace.get(i).getStrength(); //疼痛强度
                symptom = Temp_ListPlace.get(i).getSymptom();//疼痛症状
                startDate = Temp_ListPlace.get(i).getStartDate();//疼痛周期
                frequency = Temp_ListPlace.get(i).getFrequency();//疼痛频率
                //问题一
                if (("极轻").equals(strength)) {
                    cb_weak.setChecked(true);
                }
                if (("轻微").equals(strength)) {
                    cb_center.setChecked(true);
                }
                if (("中度").equals(strength)) {
                    cb_better.setChecked(true);
                }
                if (("重").equals(strength)) {
                    cb_first_very.setChecked(true);
                }
                if (("极重").equals(strength)) {
                    cb_first_zhong.setChecked(true);
                }
                //问题2
                if (("刺痛").equals(symptom)) {
                    cb_s_ct.setChecked(true);
                }
                if (("僵硬感").equals(symptom)) {
                    cb_s_jy.setChecked(true);
                }
                if (("串麻痛").equals(symptom)) {
                    cb_s_cm.setChecked(true);
                }
                if (("酸痛").equals(symptom)) {
                    cb_s_st.setChecked(true);
                }
                if (("灼热性").equals(symptom)) {
                    cb_s_zr.setChecked(true);
                }
                //问题3
                if (("近两周内").equals(startDate)) {
                    cb_t_newadd.setChecked(true);
                }
                if (("2-3周前").equals(startDate)) {
                    cb_t_one.setChecked(true);
                }
                if (("3个月前").equals(startDate)) {
                    cb_t_seconed.setChecked(true);
                }
                if (("3-6个月前").equals(startDate)) {
                    cb_t_third.setChecked(true);
                }
                if (("大于6个月").equals(startDate)) {
                    cb_t_four.setChecked(true);
                }
                //问题4
                if (("持续不断").equals(frequency)) {
                    cb_f_alltime.setChecked(true);
                }
                if (("经常发生").equals(frequency)) {
                    cb_f_sometimes.setChecked(true);
                }
                if (("偶尔发生").equals(frequency)) {
                    cb_f_oe.setChecked(true);
                }

            }
        }

    }

    /**
     * 疼痛位置
     */
    public void getPointPlaceData() {
        Request<String> mRequest = NoHttp.createStringRequest(HttpIP.GetPointPlace, Const.POST);
        mRequest.addHeader("token", PreferencesUtils.getString(ChoosePainPlaceActivity.this, "uid"));
        mRequest.add("assessId", getIntent().getStringExtra("id"));
        mRequest.add("rows", "100");
        // 添加到请求队列
        CallServer.getRequestInstance().add(ChoosePainPlaceActivity.this, 0, mRequest,
                new CustomHttpListener(ChoosePainPlaceActivity.this, true, PointPlaceM.class) {
                    @Override
                    public void doWork(Object data, boolean isOne) {
                        PointPlaceM model = ((PointPlaceM) data);
                        Temp_index.clear();
                        if (model.getRows().size() > 0) {
                            for (int i = 0; i < model.getRows().size(); i++) {
                                Temp_index.add(model.getRows().get(i).getPainSiteCode());
                            }
                        }
                        Temp_ListPlace.clear();
                        Temp_ListPlace.addAll(model.getRows());
                        ChangePicState(Temp_index);
                    }

                    @Override
                    public void onFinally(JSONObject obj) throws JSONException {
                        super.onFinally(obj);
                    }
                }, true, true);
    }

    /**
     * 选中图片
     */
    public void getChooseData() {
        Request<String> mRequest = NoHttp.createStringRequest(HttpIP.MarkPlace, Const.POST);
        mRequest.addHeader("token", PreferencesUtils.getString(ChoosePainPlaceActivity.this, "uid"));
        mRequest.add("assessId", getIntent().getStringExtra("id"));
        mRequest.add("painSiteCode", index);
        mRequest.add("strength", strength);
        mRequest.add("symptom", symptom);
        mRequest.add("startDate", startDate);
        mRequest.add("frequency", frequency);
        mRequest.add("painSiteName", choose_name);
        // 添加到请求队列
        CallServer.getRequestInstance().add(ChoosePainPlaceActivity.this, 0, mRequest,
                new CustomHttpListener(ChoosePainPlaceActivity.this, true, ChoosePintPlaceM.class) {
                    @Override
                    public void doWork(Object data, boolean isOne) {
                        ChoosePintPlaceM model = ((ChoosePintPlaceM) data);
                        getPointPlaceData();
//                        CommonUtil.showToask(ChoosePainPlaceActivity.this,"index="+index+";"+model.getObject().getPainSiteCode());
                    }

                    @Override
                    public void onFinally(JSONObject obj) throws JSONException {
                        super.onFinally(obj);

                    }
                }, true, false);
    }

    /**
     * 删除图片
     */
    public void getDelChooseData() {
        Request<String> mRequest = NoHttp.createStringRequest(HttpIP.DelPointPlace, Const.POST);
        mRequest.addHeader("token", PreferencesUtils.getString(ChoosePainPlaceActivity.this, "uid"));
        mRequest.add("assessId", getIntent().getStringExtra("id"));
        mRequest.add("painSiteCode", index);
        // 添加到请求队列
        CallServer.getRequestInstance().add(ChoosePainPlaceActivity.this, 0, mRequest,
                new CustomHttpListener(ChoosePainPlaceActivity.this, true, CommonM.class) {
                    @Override
                    public void doWork(Object data, boolean isOne) {
                        CommonM model = ((CommonM) data);
                        getPointPlaceData();
                    }

                    @Override
                    public void onFinally(JSONObject obj) throws JSONException {
                        super.onFinally(obj);
                        CommonUtil.showToask(ChoosePainPlaceActivity.this, obj.getString("msg"));

                    }
                }, true, false);
    }

    /**
     * 图片状态
     */
    public void ChangePicState(ArrayList<String> list) {
        if (IsZheng == 0) {
            SetMoRenState();
            for (int i = 0; i < list.size(); i++) {
                if (("01").equals(list.get(i))) {
                    imvTou1.setBackgroundResource(R.drawable.b01_zuo_tou);
                }
                if (("02").equals(list.get(i))) {
                    imvJing1.setBackgroundResource(R.drawable.b02_zuo_jing);
                }
                if (("03").equals(list.get(i))) {
                    imvXiong2.setBackgroundResource(R.drawable.b03_zuo_xiong);
                }
                if (("04").equals(list.get(i))) {
                    imvFu1.setBackgroundResource(R.drawable.b04_zuo_fu);
                }
                if (("05").equals(list.get(i))) {
                    imvTun1.setBackgroundResource(R.drawable.b05_zuo_kuan);
                }
                if (("06").equals(list.get(i))) {
                    imvBigtui1.setBackgroundResource(R.drawable.b06_zuo_datui);
                }
                if (("07").equals(list.get(i))) {
                    imvXg1.setBackgroundResource(R.drawable.b07_zuo_xi);
                }
                if (("08").equals(list.get(i))) {
                    imvSmalltui1.setBackgroundResource(R.drawable.b08_zuo_xiaotui);
                }
                if (("09").equals(list.get(i))) {
                    imvFoot1.setBackgroundResource(R.drawable.b09_zu);
                }
                if (("10").equals(list.get(i))) {
                    imvTou2.setBackgroundResource(R.drawable.b10_yuo_tou);
                }
                if (("11").equals(list.get(i))) {
                    imvJing2.setBackgroundResource(R.drawable.b11_yuo_jing);
                }
                if (("12").equals(list.get(i))) {
                    imvXiong3.setBackgroundResource(R.drawable.b12_yuo_xiong);
                }
                if (("13").equals(list.get(i))) {
                    imvFu2.setBackgroundResource(R.drawable.b13_yuo_fu);
                }
                if (("14").equals(list.get(i))) {
                    imvTun2.setBackgroundResource(R.drawable.b14_yuo_kuan);
                }
                if (("15").equals(list.get(i))) {
                    imvBigtui2.setBackgroundResource(R.drawable.b15_yuo_datui);
                }
                if (("16").equals(list.get(i))) {
                    imvXg2.setBackgroundResource(R.drawable.b16_yuo_xi);
                }
                if (("17").equals(list.get(i))) {
                    imvSmalltui2.setBackgroundResource(R.drawable.b17_yuo_xiaotui);
                }
                if (("18").equals(list.get(i))) {
                    imvFoot2.setBackgroundResource(R.drawable.b18_yuo_jiao);
                }
                if (("19").equals(list.get(i))) {
                    imvLeftB1.setBackgroundResource(R.drawable.b19_zuo_jian);
                }
                if (("20").equals(list.get(i))) {
                    imvLeftB2.setBackgroundResource(R.drawable.b20_zuo_shangbi);
                }
                if (("21").equals(list.get(i))) {
                    imvLeftB3.setBackgroundResource(R.drawable.b21_zuo_zhou);
                }
                if (("22").equals(list.get(i))) {
                    imvLeftB4.setBackgroundResource(R.drawable.b22_zuo_qianbi);
                }
                if (("23").equals(list.get(i))) {
                    imvLeftB5.setBackgroundResource(R.drawable.b23_zuo_wan);
                }
                if (("24").equals(list.get(i))) {
                    imvLeftB6.setBackgroundResource(R.drawable.b24_zuo_shou);
                }
                if (("25").equals(list.get(i))) {
                    imvRightB1.setBackgroundResource(R.drawable.b25_yuo_jian);
                }
                if (("26").equals(list.get(i))) {
                    imvRightB2.setBackgroundResource(R.drawable.b26_yuo_shangbi);
                }
                if (("27").equals(list.get(i))) {
                    imvRightB3.setBackgroundResource(R.drawable.b27_yuo_zhou);
                }
                if (("28").equals(list.get(i))) {
                    imvRightB4.setBackgroundResource(R.drawable.b28_yuo_xiabi);
                }
                if (("29").equals(list.get(i))) {
                    imvRightB5.setBackgroundResource(R.drawable.b29_yuo_wan);
                }
                if (("30").equals(list.get(i))) {
                    imvRightB6.setBackgroundResource(R.drawable.b30_yuo_shou);
                }
            }
        } else {//背面
            SetBeiPics();
            for (int i = 0; i < list.size(); i++) {
                if (("31").equals(list.get(i))) {
                    imvTou1.setBackgroundResource(R.drawable.d31);
                }
                if (("32").equals(list.get(i))) {
                    imvJing1.setBackgroundResource(R.drawable.d32);
                }
                if (("33").equals(list.get(i))) {
                    imvXiong2.setBackgroundResource(R.drawable.d33);
                }
                if (("34").equals(list.get(i))) {
                    imvFu1.setBackgroundResource(R.drawable.d34);
                }
                if (("35").equals(list.get(i))) {
                    imvTun1.setBackgroundResource(R.drawable.d35);
                }
                if (("36").equals(list.get(i))) {
                    imvBigtui1.setBackgroundResource(R.drawable.d36);
                }
                if (("37").equals(list.get(i))) {
                    imvXg1.setBackgroundResource(R.drawable.d37);
                }
                if (("38").equals(list.get(i))) {
                    imvSmalltui1.setBackgroundResource(R.drawable.d38);
                }
                if (("39").equals(list.get(i))) {
                    imvFoot1.setBackgroundResource(R.drawable.d39);
                }
                if (("40").equals(list.get(i))) {
                    imvTou2.setBackgroundResource(R.drawable.d40);
                }
                if (("41").equals(list.get(i))) {
                    imvJing2.setBackgroundResource(R.drawable.d41);
                }
                if (("42").equals(list.get(i))) {
                    imvXiong3.setBackgroundResource(R.drawable.d42);
                }
                if (("43").equals(list.get(i))) {
                    imvFu2.setBackgroundResource(R.drawable.d43);
                }
                if (("44").equals(list.get(i))) {
                    imvTun2.setBackgroundResource(R.drawable.d44);
                }
                if (("45").equals(list.get(i))) {
                    imvBigtui2.setBackgroundResource(R.drawable.d45);
                }
                if (("46").equals(list.get(i))) {
                    imvXg2.setBackgroundResource(R.drawable.d46);
                }
                if (("47").equals(list.get(i))) {
                    imvSmalltui2.setBackgroundResource(R.drawable.d47);
                }
                if (("48").equals(list.get(i))) {
                    imvFoot2.setBackgroundResource(R.drawable.d48);
                }
                if (("49").equals(list.get(i))) {
                    imvLeftB1.setBackgroundResource(R.drawable.d49);
                }
                if (("50").equals(list.get(i))) {
                    imvLeftB2.setBackgroundResource(R.drawable.d50);
                }
                if (("51").equals(list.get(i))) {
                    imvLeftB3.setBackgroundResource(R.drawable.d51);
                }
                if (("52").equals(list.get(i))) {
                    imvLeftB4.setBackgroundResource(R.drawable.d52);
                }
                if (("53").equals(list.get(i))) {
                    imvLeftB5.setBackgroundResource(R.drawable.d53);
                }
                if (("54").equals(list.get(i))) {
                    imvLeftB6.setBackgroundResource(R.drawable.d54);
                }
                if (("55").equals(list.get(i))) {
                    imvRightB1.setBackgroundResource(R.drawable.d55);
                }
                if (("56").equals(list.get(i))) {
                    imvRightB2.setBackgroundResource(R.drawable.d56);
                }
                if (("57").equals(list.get(i))) {
                    imvRightB3.setBackgroundResource(R.drawable.d57);
                }
                if (("58").equals(list.get(i))) {
                    imvRightB4.setBackgroundResource(R.drawable.d58);
                }
                if (("59").equals(list.get(i))) {
                    imvRightB5.setBackgroundResource(R.drawable.d59);
                }
                if (("60").equals(list.get(i))) {
                    imvRightB6.setBackgroundResource(R.drawable.d60);
                }
            }


        }
    }

    /**
     * 正面图片默认
     */
    public void SetMoRenState() {
        imvTou1.setBackgroundResource(R.drawable.a01gray_zuo_tou);
        imvTou2.setBackgroundResource(R.drawable.a10gray_yuo_tou);

        imvJing1.setBackgroundResource(R.drawable.a02gray_zuo_jing);
        imvJing2.setBackgroundResource(R.drawable.a11gray_yuo_jing);

        imvLeftB1.setBackgroundResource(R.drawable.a19gray_zuo_jian);
        imvLeftB2.setBackgroundResource(R.drawable.a20gray_zuo_shangbi);
        imvLeftB3.setBackgroundResource(R.drawable.a21gray_zuo_zhou);
        imvLeftB4.setBackgroundResource(R.drawable.a22gray_zuo_qianbi_b);
        imvLeftB5.setBackgroundResource(R.drawable.a23gray_zuo_wan_b);
        imvLeftB6.setBackgroundResource(R.drawable.a24gray_zuo_shou_b);

        imvRightB1.setBackgroundResource(R.drawable.a25gray_yuo_jian);
        imvRightB2.setBackgroundResource(R.drawable.a26gray_yuo_shangbi);
        imvRightB3.setBackgroundResource(R.drawable.a27gray_yuo_zhou);
        imvRightB4.setBackgroundResource(R.drawable.a28gray_yuo_xiabi);
        imvRightB5.setBackgroundResource(R.drawable.a29gray_yuo_wan);
        imvRightB6.setBackgroundResource(R.drawable.a30gray_yuo_shou);

        imvXiong2.setBackgroundResource(R.drawable.a03gray_zuo_xiong);
        imvXiong3.setBackgroundResource(R.drawable.a12gray_yuo_xiong);

        imvFu1.setBackgroundResource(R.drawable.a04gray_zuo_fu);
        imvFu2.setBackgroundResource(R.drawable.a13gray_yuo_fu);

        imvTun1.setBackgroundResource(R.drawable.a05gray_zuo_kuan);
        imvTun2.setBackgroundResource(R.drawable.a14gray_yuo_kuan);

        imvBigtui1.setBackgroundResource(R.drawable.a06gray_zuo_datui);
        imvBigtui2.setBackgroundResource(R.drawable.a15gray_yuo_datui);

        imvXg1.setBackgroundResource(R.drawable.a07gray_zuo_xi);
        imvXg2.setBackgroundResource(R.drawable.a16gray_yuo_xi);

        imvSmalltui1.setBackgroundResource(R.drawable.a08gray_zuo_xiaotui);
        imvSmalltui2.setBackgroundResource(R.drawable.a17gray_yuo_xiaotui);

        imvFoot1.setBackgroundResource(R.drawable.a09gray_zu);
        imvFoot2.setBackgroundResource(R.drawable.a18gray_yuo_jiao);


    }


    /**
     * 背面图片默认
     */
    public void SetBeiPics() {
        imvTou1.setBackgroundResource(R.drawable.c31_zuo_tou);
        imvTou2.setBackgroundResource(R.drawable.c40_you_tou);

        imvJing1.setBackgroundResource(R.drawable.c32_zuo_jing);
        imvJing2.setBackgroundResource(R.drawable.c41_you_jing);

        imvLeftB1.setBackgroundResource(R.drawable.c49_zuo_jian);
        imvLeftB2.setBackgroundResource(R.drawable.c50_zuo_shangbi);
        imvLeftB3.setBackgroundResource(R.drawable.c51_zuo_zhou);
        imvLeftB4.setBackgroundResource(R.drawable.c52_zuo_qianbi);
        imvLeftB5.setBackgroundResource(R.drawable.c53_zuo_wan);
        imvLeftB6.setBackgroundResource(R.drawable.c54_zuo_shou);

        imvRightB1.setBackgroundResource(R.drawable.c55_you_jian);
        imvRightB2.setBackgroundResource(R.drawable.c56_you_shangbi);
        imvRightB3.setBackgroundResource(R.drawable.c57_you_zhou);
        imvRightB4.setBackgroundResource(R.drawable.c58_you_xiaobi);
        imvRightB5.setBackgroundResource(R.drawable.c59_you_wan);
        imvRightB6.setBackgroundResource(R.drawable.c60_you_shou);

        imvXiong2.setBackgroundResource(R.drawable.c33_you_jian);
        imvXiong3.setBackgroundResource(R.drawable.c42_zuo_jian);

        imvFu1.setBackgroundResource(R.drawable.c34_zuo_fu);
        imvFu2.setBackgroundResource(R.drawable.c43_you_fu);

        imvTun1.setBackgroundResource(R.drawable.c35_zuo_tun);
        imvTun2.setBackgroundResource(R.drawable.c44_you_tun);

        imvBigtui1.setBackgroundResource(R.drawable.c36_zuo_datui);
        imvBigtui2.setBackgroundResource(R.drawable.c45_you_datui);

        imvXg1.setBackgroundResource(R.drawable.c37_zuo_xi);
        imvXg2.setBackgroundResource(R.drawable.c46_you_xi);

        imvSmalltui1.setBackgroundResource(R.drawable.c38_zuo_xiaotui);
        imvSmalltui2.setBackgroundResource(R.drawable.c47_you_xiaotui);

        imvFoot1.setBackgroundResource(R.drawable.c39_you_zu);
        imvFoot2.setBackgroundResource(R.drawable.c48_you_zu);


    }
   /* @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            if(pop.isShowing()){
                pop.dismiss();
                for (int i = 0; i < Temp_index.size(); i++) {
                    if (index.equals(Temp_index.get(i))) {
                        Temp_index.remove(i);
                        ChangePicState(Temp_index);
                    }
                }
            }
        }
        return false;
    }*/

}
